package com.kongwg.java;

import org.junit.Test;

/**
 * @author kongwg
 * @create 2020-12-29 18:51
 */
public class Person {

    @Test
    public void test1(){
        float f = 3.08f;
        double d = 3.12;
    }

    @Test
    public void test2(){

                int x=0,y=1;
                if(++x==y-- & x++==1||--y==0)
                    System.out.println("x="+x+",y="+y);   //x = 2,y = 0;
                else
                    System.out.println("y="+y+",x="+x);




    }

    @Test
    public void test3(){
        String str1 = Integer.toBinaryString(15);
        String str2 = Integer.toHexString(15);

        System.out.println(str1);
        System.out.println(str2);
    }
    @Test
    public void test4(){
        int h = 80;
        double s = (h - 32) / 1.8;
        System.out.println(h + "华氏度，是摄氏度" + Math.round(s));

    }

    @Test
    public void test5(){
        int a=3,b=8;

        int c=(a>b)?a++:b++;
        System.out.println("a="+a+"\tb="+b+"\tc="+c);  //a=3 b=9 c=8

        int d=(a>b)?++a:++b;
        System.out.println("a="+a+"\tb="+b+"\td="+d);  //a=3 b=10 d 10

        int e=(a<b)?a++:b++;
        System.out.println("a="+a+"\tb="+b+"\te="+e);  //a=4 b=10 e=3
//
        int f=(a<b)?++a:++b;
        System.out.println("a="+a+"\tb="+b+"\tf="+f);  //a=5 b=10 f5


        short s1 =1;
        s1 = (short) (s1 + 1);
        s1 += 1;

        String str1 = "ajlf;asjdf";
        int length = str1.length();
        System.out.println(length);
    }
}
